﻿  CREATE proc [dbo].[danhmucKhoanMucPhi_them] --'12344','gsfdgfd','123'           
@Ma_KMuc varchar(25),            
@Ten_KMuc nvarchar(200),    
@Malh varchar(25)        
as            
declare @dem as int            
select @dem= COUNT(*) from DM_KhoanMucChiPhi  where Ma_KMuc=@Ma_KMuc          
if(@dem>0)            
begin            
select ErrCode=0            
end            
else            
begin            
insert into  DM_KhoanMucChiPhi (Ma_KMuc,Ten_KMuc,Malh) values(@Ma_KMuc,@Ten_KMuc,@Malh)            
select ErrCode=1            
end 